<template>
  <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" class="serverTabs">
    <el-tab-pane :label="$t('默认报表任务')" name="first">
      <DiyReportRe></DiyReportRe>
    </el-tab-pane>
    <el-tab-pane :label="$t('定制报表任务')" name="second">
      <DiyReport v-if="loading === 'second'"></DiyReport>
    </el-tab-pane>
  </el-tabs>
</template>
<script>
import DiyReportRe from './components/DiyReportRe'
import DiyReport from './components/DiyReport'
export default {
  name: 'Server',
  components: {
    DiyReportRe,
    DiyReport
  },
  data () {
    return {
      activeName: 'first',
      loading: ''
    }
  },
  methods: {
    handleClick (tab, event) {
      this.loading = tab.name
    }
  }
}
</script>
<style lang="less">
.serverTabs {
  .el-tabs__nav {
    margin-left: 20px;
  }
}
</style>
